<template>
  <div class="charts" ref="charts">
  </div>
</template>

<script>
import * as echarts from 'echarts';
export default {
  name: 'ProgressCharts',
  mounted () {
    //初始化echarts实例
    let lineCharts = echarts.init(this.$refs.charts);
    //配置数据
    lineCharts.setOption({
      xAxis: {
        show: false,
        //最大值最小值的设置
        min:0,
        max:100,
      },
      yAxis: {
        show: false,
        type: 'category'
      },
      series: [
        {
            //柱状图
          type: 'bar',
          barWidth:10,
          data: [78],
          color:'yellowgreen',
          showBackground:true,
           backgroundStyle:{
            color:'#eee',
           },
        // 文本标签
           label:{
            show:true,
            formatter:'|',
            position:'right'
           }
        },
      ],
      //布局调整
      grid: {
        left: 0,
        top: 0,
        right: 0,
        bottom: 0
      },
    })
  }
}
</script>

<style scoped>
.charts {
  height: 100%;
  width: 100%;
}
</style>